﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VNTG.TaxonomyUploader.model
{
    class MyTerm
    {
        public Dictionary<int, string> Language
        {
            get;
            set;
        }
        public List<MyTerm> Childeren
        {
            get;
            set;
        }
        public MyTerm()
        {
            Language = new Dictionary<int, string>();
            Childeren = new List<MyTerm>();
        }
        public MyTerm GetTerm(string title)
        {
            MyTerm term = new MyTerm();

            if (this.HasChilderen())
            {
                foreach (MyTerm item in Childeren)
                {
                    if (item.Language.Values.Contains(title))
                    {
                        term = item;
                        break;
                    }
                }
            }
            return term;
        }
        public bool HasChilderen()
        {
            return (Childeren.Count != 0);
        }
    }
}
